home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / ear / mui23dev.lha / MUI / Developer / ExtClasses / MCC_UserData / ShowUserData.c < prev    next >
C/C++ Source or Header  |  1994-12-23  |  2KB  |  84 lines

  1. /*
  2. ** Little tool to show the UserData custom class.
  3. */
  4.  
  5. #include "demo.h"
  6. #include "UserData_mcc.h"
  7.  
  8.  
  9. int main(int argc,char *argv[])
  10. {
  11.     Object *app,*win,*sasg;
  12.     ULONG signals;
  13.     BOOL running = TRUE;
  14.  
  15.     init();
  16.  
  17.     app = ApplicationObject,
  18.         MUIA_Application_Title      , "ShowUserData",
  19.         MUIA_Application_Version    , "$VER: ShowUserData 10.11 (23.12.94)",
  20.         MUIA_Application_Copyright  , "©1994 by Stefan Stuntz",
  21.         MUIA_Application_Author     , "Stefan Stuntz",
  22.         MUIA_Application_Description, "Show the UserData custom class",
  23.         MUIA_Application_Base       , "SHOWUSERDATA",
  24.  
  25.         SubWindow, win = WindowObject,
  26.             MUIA_Window_Title, "Show the UserData public custom class",
  27.             MUIA_Window_ID   , MAKE_ID('S','A','S','G'),
  28.  
  29.             WindowContents, VGroup,
  30.  
  31.                 Child, sasg = MUI_NewObject(MUIC_UserData,
  32.                     MUIA_UserData_First  , "Jo",
  33.                     MUIA_UserData_Name   , "User",
  34.                     MUIA_UserData_Street , "Fakestreet 12",
  35.                     MUIA_UserData_City   , "Faketown, FT 1234",
  36.                     MUIA_UserData_Country, "Wonderland",
  37.                     MUIA_UserData_Phone  , "+1-234-567-8901",
  38.                     MUIA_UserData_EMail  , "jouser@fake.wonder.land",
  39.                     TAG_DONE),
  40.  
  41.                 End,
  42.             End,
  43.         End;
  44.  
  45.     if (!app)
  46.         fail(app,"Failed to create Application.");
  47.  
  48.  
  49. /*
  50. ** Install notification events...
  51. */
  52.  
  53.     DoMethod(win,MUIM_Notify,MUIA_Window_CloseRequest,TRUE,
  54.         app,2,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit);
  55.  
  56.  
  57. /*
  58. ** Input loop...
  59. */
  60.  
  61.     set(win,MUIA_Window_Open,TRUE);
  62.  
  63.     while (running)
  64.     {
  65.         switch (DoMethod(app,MUIM_Application_Input,&signals))
  66.         {
  67.             case MUIV_Application_ReturnID_Quit:
  68.                 running = FALSE;
  69.                 break;
  70.         }
  71.  
  72.         if (running && signals) Wait(signals);
  73.     }
  74.  
  75.     set(win,MUIA_Window_Open,FALSE);
  76.  
  77.  
  78. /*
  79. ** Shut down...
  80. */
  81.  
  82.     fail(app,NULL);
  83. }
  84.